package java_thinking.unit_21._21_7;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * @Desc:   7-24 UncaughtExceptionHandler 接口
 * @author: cww
 * @DateTime: 2019-06-16 20:09
 */

public class UEHLogger implements Thread.UncaughtExceptionHandler {
    @Override
    public void uncaughtException(Thread t, Throwable e) {
        Logger logger = Logger.getAnonymousLogger();
        logger.log(Level.SEVERE, "Thread terminated with exception: " + t.getName(), e);
    }
}
